//
//  HistoryTableViewCell.m
//  JKFuYinProject
//
//  Created by 九酷 on 2017/9/12.
//  Copyright © 2017年 LC. All rights reserved.
//

#import "HistoryTableViewCell.h"

@implementation HistoryTableViewCell
-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.imageIcon = [[UIImageView alloc]init];
        [self addSubview:self.imageIcon];
        self.imageIcon.frame = CGRectMake(10, 10, 34, 30);

        self.labelRecord = [[UILabel alloc]init];
        self.labelRecord.textColor = titleColorLSZ;
        [LSZSpecialPackaging setLabel_14_5_Size:self.labelRecord];
        [self addSubview:self.labelRecord];

        self.labelChapter = [[UILabel alloc]init];
        self.labelChapter.textColor = lightColor;
        [LSZSpecialPackaging setLabelAdaptiveSize:self.labelChapter font:13];
        [self addSubview:self.labelChapter];

        if (ScreenWidth == 320) {
            //5
            self.labelRecord.frame = CGRectMake(CGRectGetMaxX(self.imageIcon.frame)+5, 5.5, ScreenWidth-CGRectGetMaxX(self.imageIcon.frame)-24,16);
            self.labelChapter.frame = CGRectMake(CGRectGetMaxX(self.imageIcon.frame)+5, CGRectGetMaxY(self.labelRecord.frame)+2, ScreenWidth-CGRectGetMaxX(self.imageIcon.frame)-24, 14);
        }else if(ScreenWidth == 375){
            // 6 7
            self.labelRecord.frame = CGRectMake(CGRectGetMaxX(self.imageIcon.frame)+5, 7, ScreenWidth-CGRectGetMaxX(self.imageIcon.frame)-24,18);
            self.labelChapter.frame = CGRectMake(CGRectGetMaxX(self.imageIcon.frame)+5, CGRectGetMaxY(self.labelRecord.frame)+2, ScreenWidth-CGRectGetMaxX(self.imageIcon.frame)-24, 16);
        }else {
            //plus
            self.labelRecord.frame = CGRectMake(CGRectGetMaxX(self.imageIcon.frame)+5, 9, ScreenWidth-CGRectGetMaxX(self.imageIcon.frame)-24,20);
            self.labelChapter.frame = CGRectMake(CGRectGetMaxX(self.imageIcon.frame)+5, CGRectGetMaxY(self.labelRecord.frame)+2, ScreenWidth-CGRectGetMaxX(self.imageIcon.frame)-24, 18);
        }
        [self setupUI];
    }
    return self;
}
- (void)setupUI
{
    [self.imageIcon mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self);
        make.left.equalTo(self.mas_left).offset(20);
        make.width.height.mas_equalTo(self.imageIcon);
    }];
}
@end
